
OriginalStr = 'MEET ME AT BIGTREE NINE AM'
# ord('A') -> 65
# ord('Z') -> 90
EncryptedStr = []
for i in range(0,len(OriginalStr),1):
    print(ord(OriginalStr[i]))
    if ord(OriginalStr[i]) >= 65 and ord(OriginalStr[i]) <= 90:
        Ascii = (ord(OriginalStr[i]) - 65 + 3) % 26 
        Ascii = Ascii + 65
        EncryptedStr.append(chr(Ascii))
    else:
        EncryptedStr.append(OriginalStr[i])
    print(EncryptedStr[i])

print("The original  string is %s" % OriginalStr)
print("The encrypted string is %s" % "".join(EncryptedStr))

RestoredStr = []
for i in range(0,len(EncryptedStr),1):
    if ord(EncryptedStr[i]) >= 65 and ord(EncryptedStr[i]) <= 90:
        Ascii = (ord(EncryptedStr[i]) - 65 - 3) % 26 
        Ascii = Ascii + 65
        RestoredStr.append(chr(Ascii))
    else:
        RestoredStr.append(OriginalStr[i])
print("The restored  string is %s" % "".join(RestoredStr))